import Layout from '@/layout/index.vue'
import { createNameComponent } from '../createNode'
const route = [
  {
    path: '/',
    component: Layout,
    redirect: '/dashboard',
    meta: { title: 'message.menu.dashboard.name', icon: 'sfont system-home' },
    children: [
      {
        path: 'dashboard',
        component: createNameComponent(() => import('@/views/main/dashboard/index.vue')),
        meta: { title: 'message.menu.dashboard.index', icon: 'sfont system-home', hideClose: true }
      }
    ]
  }
  ,{
    path: '/user',
    component: Layout,
    redirect: '/user/userManagement ',
    meta: {
      title: '用户管理',
      icon: 'el-icon-copy-document'
    },
    children: [{
        path: 'doctor',
        component: createNameComponent(() => import('@/views/user/doctor/index.vue')),
        name: 'doctor',
        meta: {
          title: '医生管理',
          icon: '',
          hideClose: false
        },
      },
      {
        path: 'doctor/add',
        component: createNameComponent(() => import('@/views/user/doctor/components/add.vue')),
        name: 'doctor_add',
        hideMenu: true,
        meta: {
          title: '新增医生',
          icon: 'el-icon-upload-filled',
        },
      },
      {
        path: 'doctor/edit',
        component: createNameComponent(() => import('@/views/user/doctor/components/add.vue')),
        name: 'doctor_edit',
        hideMenu: true,
        meta: {
          title: '编辑医生',
          icon: 'el-icon-upload-filled'
        },
      },{
          path: 'doctor/pharmacist',
          component: createNameComponent(() => import('@/views/user/pharmacist/index.vue')),
          name: 'doctor_pharmacist',
          meta: {
            title: '平台药师管理',
            icon: '',
            hideClose: false
          },
        }
    ],
  },
  {
    path: '/baseInfo',
    component: Layout,
    redirect: '/baseInfo/user',
    name: 'Nested',
    meta: {
      title: '基础数据',
      icon: 'el-icon-copy-document'
    },
    children: [{
        path: 'user',
        name: 'user',
        meta: {
          title: '用户基础数据'
        },
        redirect: '/baseInfo/user/title',
        children: [{
            path: 'dept',
            component: createNameComponent(() => import('@/views/baseInfo/user/dept/index.vue')),
            name: 'dept',
            meta: {
              title: '科室管理'
            },
          },
          {
            path: 'title',
            component: createNameComponent(() => import('@/views/baseInfo/user/title/index.vue')),
            name: 'title',
            meta: {
              title: '职称管理'
            },
          },
          {
            path: 'hospital',
            component: createNameComponent(() => import('@/views/baseInfo/user/hospital/index.vue')),
            name: 'hospital',
            meta: {
              title: '医院管理'
            },
          },
          {
            path: 'disease',
            component: createNameComponent(() => import('@/views/baseInfo/user/disease/index.vue')),
            name: 'disease',
            meta: {
              title: '疾病标签管理'
            },
          },
          {
            path: 'doctorLabel',
            component: createNameComponent(() => import('@/views/baseInfo/user/doctorLabel/index.vue')),
            name: 'doctorLabel',
            meta: {
              title: '医生标签管理'
            },
          },
          {
            path: 'mechanism',
            component: createNameComponent(() => import('@/views/baseInfo/user/mechanism/index.vue')),
            name: 'mechanism',
            meta: {
              title: '机构设置'
            },
          }
        ],
      },
      {
        path: 'drug',
        name: 'drug',
        meta: {
          title: '药品基础数据'
        },
        redirect: '/data/user/drug/drug_fear_back',
        children: [{
            path: 'drug_fear_back',
            component: createNameComponent(() => import('@/views/data/drug/drugFearBack/index.vue')),
            name: 'drug_fear_back',
            meta: {
              title: '十八反十九畏'
            },
          },
          {
            path: 'drug_process_type',
            component: createNameComponent(() => import('@/views/data/drug/drugProcessType/index.vue')),
            name: 'drug_process_type',
            meta: {
              title: '加工方式药态设置'
            },
          },
          {
            path: 'usage_dosage',
            component: createNameComponent(() => import('@/views/data/drug/usageDosage/index.vue')),
            name: 'usage_dosage',
            meta: {
              title: '中药用法设置'
            },
          },
          {
            path: 'usage_dosage_western',
            component: createNameComponent(() => import('@/views/data/drug/usageDosageX/index.vue')),
            name: 'usage_dosage_western',
            meta: {
              title: '西药用法设置'
            }
          },
          {
            path: 'usage_dosage_word',
            component: createNameComponent(() => import('@/views/data/drug/usageDosageWord/index.vue')),
            name: 'usage_dosage_word',
            meta: {
              title: '单次剂量设置'
            },
          },
          {
            path: 'usage_dosage_frequency',
            component: createNameComponent(() => import('@/views/data/drug/usageDosageFrequency/index.vue')),
            name: 'usage_dosage_frequency',
            meta: {
              title: '用药频率设置'
            },
          },
          {
            path: 'drug_type',
            component: createNameComponent(() => import('@/views/data/drug/drugType/index.vue')),
            name: 'drug_type',
            meta: {
              title: '药品类型设置'
            },
          },
          {
            path: 'accessories',
            component: createNameComponent(() => import('@/views/data/drug/accessories/index.vue')),
            name: 'accessories',
            meta: {
              title: '辅料设置'
            },
          },
          {
            path: 'drug_unit',
            component: createNameComponent(() => import('@/views/data/drug/drugUnit/index.vue')),
            name: 'drug_unit',
            meta: {
              title: '药品单位设置'
            },
          },
          {
            path: 'drug_specification',
            component: createNameComponent(() => import('@/views/data/drug/drugSpecification/index.vue')),
            name: 'drug_specification',
            meta: {
              title: '药品规格设置'
            },
          },
          {
            path: 'decoction',
            component: createNameComponent(() => import('@/views/data/drug/drugDecoction/index.vue')),
            name: 'decoction',
            meta: {
              title: '特殊煎煮设置'
            },
          },
          {
            path: 'drug_pack',
            component: createNameComponent(() => import('@/views/data/drug/drugPack/index.vue')),
            name: 'drug_pack',
            meta: {
              title: '药品包装设置'
            },
          }
        ],
      },
      {
        path: 'chinese_medicine',
        name: 'chinese_medicine',
        meta: {
          title: '辩证(中医诊断)设置'
        },
        component: createNameComponent(() => import('@/views/baseInfo/chinese_medicine/index.vue')),
      },
      {
        path: 'west_medicine',
        name: 'west_medicine',
        meta: {
          title: '辩病(西医诊断)设置'
        },
        component: createNameComponent(() => import('@/views/baseInfo/west_medicine/index.vue')),
      },
  
      {
        path: 'recipeOrder',
        name: 'recipeOrder',
        meta: {
          title: '处方模版管理'
        },
        redirect: '/baseInfo/recipeOrder/template_manage',
        children: [{
          path: 'template_manage',
          component: createNameComponent(() => import('@/views/baseInfo/recipeTemplate/templateManage/index.vue')),
          name: 'template_manage',
          meta: {
            title: '模版方'
          },
        }, {
          path: 'template_manage_add',
          component: createNameComponent(() => import('@/views/baseInfo/recipeTemplate/templateManage/addForm.vue')),
          name: 'template_manage_add',
          hideMenu: true,
          meta: {
            title: '新增模版方'
          },
        }, {
          path: 'template_manage_edit',
          component: createNameComponent(() => import('@/views/baseInfo/recipeTemplate/templateManage/addForm.vue')),
          name: 'template_manage_edit',
          hideMenu: true,
          meta: {
            title: '编辑模版方'
          },
        }, {
          path: 'classic_template',
          component: createNameComponent(() => import('@/views/baseInfo/recipeTemplate/classicTemplate/index.vue')),
          name: 'classic_template',
          meta: {
            title: '经典方'
          },
        }, {
          path: 'classic_template_add',
          component: createNameComponent(() => import('@/views/baseInfo/recipeTemplate/classicTemplate/addForm.vue')),
          name: 'classic_template_add',
          hideMenu: true,
          meta: {
            title: '新增经典方'
          },
        }, {
          path: 'classic_template_edit',
          component: createNameComponent(() => import('@/views/baseInfo/recipeTemplate/classicTemplate/addForm.vue')),
          name: 'classic_template_edit',
          hideMenu: true,
          meta: {
            title: '编辑经典方'
          },
        }]
      },
  
      {
        path: 'questionnaire',
        name: 'questionnaire',
        meta: {
          title: '问诊单设置'
        },
        redirect: '/baseInfo/questionnaire/list',
        children: [{
          path: 'question_list',
          component: createNameComponent(() => import('@/views/baseInfo/questionnaire/list/index.vue')),
          name: 'question_list',
          meta: {
            title: '问诊单列表'
          },
        }, {
          path: 'question_bank',
          component: createNameComponent(() => import('@/views/baseInfo/questionnaire/questionBank/index.vue')),
          name: 'question_bank',
          meta: {
            title: '问诊单题库'
          },
        },{
          path: 'question_add',
          component: createNameComponent(() => import('@/views/baseInfo/questionnaire/add/index.vue')),
          name: 'question_add',
          hideMenu: true,
          meta: {
            title: '新增问诊单'
          }
        }]
      },
    ],
  },{
  path: '/workforce',
  component: Layout,
  redirect: '/workforce/doctor_workforce',
  name: 'Workforce',
  meta: {
    title: '排班管理',
    icon:'el-icon-copy-document'
  },
  children: [
    {
      path: '/doctor_workforce',
      name: 'doctor_workforce',
      meta: {
        title: '排班管理'
      },
      component: createNameComponent(() => import('@/views/workforce/doctor_workforce/index.vue')),
    },
    {
      path: '/workforce_switch',
      name: 'workforce_switch',
      meta: {
        title: '排班开关'
      },
      component: createNameComponent(() => import('@/views/workforce/workforce_switch/index.vue')),
    },
  ],
},{
  path: '/pharmacy',
  component: Layout,
  name: 'pharmacy',
  meta: {
    title: '药房管理',
    icon: 'el-icon-copy-document'
  },
  redirect: '/pharmacy/drug',
  children: [{
      path: 'drugs',
      component: createNameComponent(() => import('@/views/pharmacy/drug/index.vue')),
      name: 'drugs',
      meta: {
        title: '主药品库'
      },
    },
    {
      path: 'sub_drugs',
      component: createNameComponent(() => import('@/views/pharmacy/subDrug/index.vue')),
      name: 'sub_drugs',
      meta: {
        title: '子药品库'
      },
    },
    {
      path: 'officina_list',
      component: createNameComponent(() => import('@/views/pharmacy/officina/officina_detail/index.vue')),
      name: 'officina_list',
      meta: {
        title: '药房设置'
      },
    },
    {
      path: 'officina_edit',
      component: createNameComponent(() => import('@/views/pharmacy/officina/officina_detail/add.vue')),
      name: 'officina_edit',
      hideMenu: true,
      meta: {
        title: '药房设置详情',
      },
    },
    {
      path: 'officina_detail',
      component: createNameComponent(() => import('@/views/pharmacy/officina/officina_detail/detail.vue')),
      name: 'officina_detail',
      hideMenu: true,
      meta: {
        title: '药房设置详情',
      },
    },
    // {
    //   path: 'pharmacist',
    //   component: createNameComponent(() => import('@/views/pharmacy/pharmacist/index.vue')),
    //   name: 'pharmacist',
    //   meta: {
    //     title: '平台药师后台',
    //   },
    // }
  ],
},{
  path: '/order_manage',
  component: Layout,
  name: 'order_manage',
  meta: {
    title: '订单管理',
    icon: 'el-icon-copy-document'
  },
  redirect: '/order_manage/index',
  children: [{
      path: 'index',
      component: createNameComponent(() => import('@/views/orderManage/recipeOrder/index.vue')),
      name: 'index',
      meta: {
        title: '处方订单'
      },
    }, {
      path: 'recipe_manage',
      component: createNameComponent(() => import('@/views/orderManage/recipeOrder/detail.vue')),
      name: 'recipe_manage',
      hideMenu: true,
      meta: {
        title: '处方订单详情'
      },
    }, {
      path: 'recipe_detail',
      component: createNameComponent(() => import('@/views/orderManage/recipeOrder/recipeDetail.vue')),
      name: 'recipe_detail',
      hideMenu: true,
      meta: {
        title: '处方详情'
      },
    }, {
      path: 'refund',
      component: createNameComponent(() => import('@/views/orderManage/recipeOrder/refund.vue')),
      name: 'refund',
      hideMenu: true,
      meta: {
        title: '退款补缴'
      },
    },
  ],
},
{
  path: '/pharmacy_backstage',
  component: Layout,
  name: 'pharmacy_backstage',
  meta: {
    title: '药房后台',
    icon: 'el-icon-copy-document'
  },
  redirect: '/pharmacy_backstage/index',
  children: [{
      path: 'prescription_index',
      component: createNameComponent(() => import('@/views/pharmacyBackstage/index.vue')),
      name: 'prescription_index',
      meta: {
        title: '药房信息'
      },
    }, {
      path: 'prescription_manage',
      component: createNameComponent(() => import('@/views/pharmacyBackstage/index.vue')),
      name: 'prescription_manage',
      meta: {
        title: '处方管理'
      },
    }
  ],
}

]

export default route